﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace PBO.Sql
{
    public interface IDBUtility
    {
        /// <summary>
        /// 运行SQL语句
        /// </summary>
        int ExecuteSql(string sql);

        /// <summary>
        /// 运行SQL语句,返回DataTable对象
        /// </summary>
        DataTable ExecuteDataTable(string sql, int startIndex, int pageSize);

        /// <summary>
        /// 运行SQL语句,返回DataTable对象
        /// </summary>
        DataTable ExecuteDataTable(string sql);

        /// <summary>
        /// 执行一条计算查询结果语句，返回查询结果（object）。
        /// </summary>
        object GetSingle(string sql);

        /// <summary>
        /// 执行多条SQL语句，实现数据库事务。
        /// </summary>
        void ExecuteSqlTran(IEnumerable<string> sqlList);
    }
}
